import request from '@/config/axios'

// 店员 VO
export interface ShopStaffVO {
  id: number | string // 唯一编号
  shopId: number // 店铺编号
  contactName: string // 姓名
  contactMobile: string // 电话
  memberUserId: number // 前台用户编号
  adminUserId: number // 后台用户编号
}

// 店员 API
export const ShopStaffApi = {
  // 查询店员分页
  getStaffPage: async (params: any) => {
    return await request.get({ url: `/shop/staff/page`, params })
  },

  // 查询店员详情
  getStaff: async (id: number) => {
    return await request.get({ url: `/shop/staff/get?id=` + id })
  },

  // 新增店员
  createStaff: async (data: ShopStaffVO) => {
    return await request.post({ url: `/shop/staff/create`, data })
  },

  // 修改店员
  updateStaff: async (data: ShopStaffVO) => {
    return await request.put({ url: `/shop/staff/update`, data })
  },

  // 删除店员
  deleteStaff: async (id: number) => {
    return await request.delete({ url: `/shop/staff/delete?id=` + id })
  },

  // 导出店员 Excel
  exportStaff: async (params) => {
    return await request.download({ url: `/shop/staff/export-excel`, params })
  }
}
